home *** CD-ROM | disk | FTP | other *** search
-
-
-
- UUUUSSSSMMMMAAAALLLLLLLLOOOOCCCC((((3333PPPP)))) UUUUSSSSMMMMAAAALLLLLLLLOOOOCCCC((((3333PPPP))))
-
-
-
- NNNNAAAAMMMMEEEE
- uuuussssmmmmaaaalllllllloooocccc,,,, uuuussssffffrrrreeeeeeee,,,, uuuussssrrrreeeeaaaalllllllloooocccc,,,, uuuussssccccaaaalllllllloooocccc,,,, uuuussssmmmmaaaalllllllloooopppptttt,,,, uuuussssmmmmaaaalllllllliiiinnnnffffoooo,,,, - shared
- arena memory allocator
-
- CCCC SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<uuuulllloooocccckkkkssss....hhhh>>>>
- ####iiiinnnncccclllluuuuddddeeee <<<<mmmmaaaalllllllloooocccc....hhhh>>>>
-
- vvvvooooiiiidddd ****uuuussssmmmmaaaalllllllloooocccc ((((ssssiiiizzzzeeee____tttt ssssiiiizzzzeeee,,,, uuuussssppppttttrrrr____tttt ****hhhhaaaannnnddddlllleeee))));;;;
-
- vvvvooooiiiidddd uuuussssffffrrrreeeeeeee ((((vvvvooooiiiidddd ****ppppttttrrrr,,,, uuuussssppppttttrrrr____tttt ****hhhhaaaannnnddddlllleeee))));;;;
-
- vvvvooooiiiidddd ****uuuussssrrrreeeeaaaalllllllloooocccc ((((vvvvooooiiiidddd ****ppppttttrrrr,,,, ssssiiiizzzzeeee____tttt ssssiiiizzzzeeee,,,, uuuussssppppttttrrrr____tttt ****hhhhaaaannnnddddlllleeee))));;;;
-
- vvvvooooiiiidddd ****uuuussssccccaaaalllllllloooocccc ((((ssssiiiizzzzeeee____tttt nnnneeeelllleeeemmmm,,,, ssssiiiizzzzeeee____tttt eeeellllssssiiiizzzzeeee,,,, uuuussssppppttttrrrr____tttt ****hhhhaaaannnnddddlllleeee))));;;;
-
- iiiinnnntttt uuuussssmmmmaaaalllllllloooopppptttt ((((iiiinnnntttt ccccmmmmdddd,,,, iiiinnnntttt vvvvaaaalllluuuueeee,,,, uuuussssppppttttrrrr____tttt ****hhhhaaaannnnddddlllleeee))));;;;
-
- ssssttttrrrruuuucccctttt mmmmaaaalllllllliiiinnnnffffoooo uuuussssmmmmaaaalllllllliiiinnnnffffoooo ((((uuuussssppppttttrrrr____tttt ****hhhhaaaannnnddddlllleeee))));;;;
-
- ssssiiiizzzzeeee____tttt uuuussssmmmmaaaallllllllooooccccbbbbllllkkkkssssiiiizzzzeeee ((((vvvvooooiiiidddd ****ppppttttrrrr,,,, uuuussssppppttttrrrr____tttt ****hhhhaaaannnnddddlllleeee))));;;;
-
- vvvvooooiiiidddd ****uuuussssrrrreeeeccccaaaalllllllloooocccc ((((vvvvooooiiiidddd ****ppppttttrrrr,,,, ssssiiiizzzzeeee____tttt nnnneeeelllleeeemmmm,,,, ssssiiiizzzzeeee____tttt eeeellllssssiiiizzzzeeee,,,,
- uuuussssppppttttrrrr____tttt ****hhhhaaaannnnddddlllleeee))));;;;
-
- vvvvooooiiiidddd ****uuuussssmmmmeeeemmmmaaaalllliiiiggggnnnn ((((ssssiiiizzzzeeee____tttt aaaalllliiiiggggnnnn,,,, ssssiiiizzzzeeee____tttt ssssiiiizzzzeeee,,,, uuuussssppppttttrrrr____tttt ****hhhhaaaannnnddddlllleeee))));;;;
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- These routines provide a simple general-purpose memory allocation package
- that allows the user to allocate from a shared arena (see _u_s_i_n_i_t(3P)).
- All these functions are MP safe, multiple threads/processes may access
- them simultaneously and are guaranteed correct behavior.
-
- More than one call can be made to _u_s_i_n_i_t(3P) to set up separate malloc
- arenas. The file name passed to _u_s_i_n_i_t(3P) is used as a key to allow
- shared arenas to be created for use amongst unrelated processes. Once
- the arena is set up, calls to _u_s_m_a_l_l_o_c will attempt to allocate space
- from the arena. If the arena gets full, NNNNUUUULLLLLLLL is returned. Note that
- this malloc arena is also used by other _u_s* calls (such as _u_s_n_e_w_l_o_c_k and
- _u_s_n_e_w_s_e_m_a ).
-
- The argument to _u_s_f_r_e_e is a pointer to a block previously allocated by
- _u_s_m_a_l_l_o_c; after _u_s_f_r_e_e is performed this space is made available for
- further allocation.
-
- Undefined results will occur if the space assigned by _u_s_m_a_l_l_o_c is overrun
- or if some random number is handed to _u_s_f_r_e_e. It is always permitted to
- pass NULL to _u_s_f_r_e_e.
-
- _u_s_r_e_a_l_l_o_c changes the size of the block pointed to by _p_t_r to _s_i_z_e bytes
- and returns a pointer to the (possibly moved) block. The contents will
- be unchanged up to the lesser of the new and old sizes. If no free block
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- UUUUSSSSMMMMAAAALLLLLLLLOOOOCCCC((((3333PPPP)))) UUUUSSSSMMMMAAAALLLLLLLLOOOOCCCC((((3333PPPP))))
-
-
-
- of _s_i_z_e bytes is available in the storage arena, then _u_s_r_e_a_l_l_o_c will ask
- _u_s_m_a_l_l_o_c to enlarge the arena by _s_i_z_e bytes and will then move the data
- to the new space. In the special case of a null _p_t_r, _u_s_r_e_a_l_l_o_c
- degenerates to _u_s_m_a_l_l_o_c. A zero _s_i_z_e causes the passed block to be
- freed.
-
- _u_s_c_a_l_l_o_c allocates space for an array of _n_e_l_e_m elements of size _e_l_s_i_z_e.
- The space is initialized to zeros.
-
- _u_s_r_e_c_a_l_l_o_c combines _u_s_r_e_a_l_l_o_c and _u_s_c_a_l_l_o_c. If the size of the block
- increases, any new bytes are initialized to zero. Note that for this to
- work properly, all allocations of a given pointer must go through
- _u_s_r_e_c_a_l_l_o_c. If the original pointer was allocated with either _u_s_m_a_l_l_o_c
- or _u_s_r_e_a_l_l_o_c some new bytes may not be set properly to zero.
-
- _u_s_m_e_m_a_l_i_g_n allocates _s_i_z_e bytes on a specified alignment boundary, and
- returns a pointer to the allocated block. The value of the returned
- address is guaranteed to be an even multiple of _a_l_i_g_n. Note: the value
- of _a_l_i_g_n must be a power of two, and must be greater than or equal to the
- size of a word, or, for 64 bit objects, the size of a doubleword.
-
- _u_s_m_a_l_l_o_c_b_l_k_s_i_z_e returns the actual size of the block pointed to by _p_t_r.
- The returned size may be greater than the original requested size due to
- padding and alignment.
-
- _u_s_m_a_l_l_o_p_t provides for control over the allocation algorithm. See
- _a_m_a_l_l_o_c(3P) for details on the allowable options.
-
- _u_s_m_a_l_l_i_n_f_o provides instrumentation describing space usage. See
- _a_m_a_l_l_o_c(3P) for details on the returned information.
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- intro(3), usinit(3P), usconfig(3P), amalloc(3P), malloc(3X).
-
- DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
- _u_s_m_a_l_l_o_c, _u_s_c_a_l_l_o_c, _u_s_r_e_c_a_l_l_o_c, and _u_s_r_e_a_l_l_o_c return a NNNNUUUULLLLLLLL pointer if
- there is no available memory or if the arena has been detectably
- corrupted by storing outside the bounds of a block. If _u_s_m_a_l_l_o_p_t is
- called after any allocation (for most _c_m_d arguments) or if _c_m_d or _v_a_l_u_e
- are invalid, non-zero is returned. Otherwise, it returns zero.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-